/*
 *  vovkulaka - entry point of application
 *
 *  Copyright (C) 2011 by Volodymyr M. Shcherbyna <volodymyr@shcherbyna.com>
 *
 *	This file is part of vovkulaka.
 *
 *  vovkulaka is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  vovkulaka is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with vovkulaka.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <windows.h>
#include <tchar.h>
#include <stdio.h>

#include "configuration.h"
#include "printersmanagement.h"

#define VOVKULALA_VERSION	TEXT("1.0.0.1")

/**   Entry point for an application

    * @return void
*/
void _tmain(int argc, TCHAR * argv[])
{
	_tprintf(TEXT("+ vovkulaka.exe version %s \r\n"), VOVKULALA_VERSION);
	_tprintf(TEXT("+ Copyright Volodymyr M. Shcherbyna 2011, www.shcherbyna.com\n\n"));

	CConfiguration config(argv[0]);
	CPrintersManagement manager(config);

	if (config.getNoConfig())
	{
		_tprintf(TEXT("No configuration file detected. Dumping the state of printer ... \r\n"));

		manager.EnumAllPrinters();
	}
	else
	{
		_tprintf(TEXT("Configuration file detected. Setting the state of printer ... \r\n"));

		if (manager.SetPrinterAttributes())
		{
			_tprintf(TEXT("Printer is properly activated. Have fun!\n"));
		}
		else
		{
			_tprintf(TEXT("Printer is not activated\n"));
		}
	}
}
                                                                  